package com.gpzx.zx.module.home.frame.view

import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager
import com.gpzx.zx.R
import com.gpzx.zx.module.home.ui.adapter.XnbAdapter
import com.gpzx.zx.module.home.ui.fragment.XnbFragment
import com.wkq.base.frame.mosby.delegate.MvpView
import com.wu.common.utils.site.XnbInfo

class XnbView(mFragment: XnbFragment) : MvpView {
    var mFragment = mFragment
    var mAdapter: XnbAdapter? = null
    fun initView() {
        mAdapter = XnbAdapter(mFragment.activity as Context, R.layout.item_xnb)
        mFragment.binding.ivContent.layoutManager = LinearLayoutManager(mFragment.activity)
        mFragment.binding.ivContent.adapter = mAdapter
    }

    fun setData(infos: List<XnbInfo>?) {
        if (mAdapter!!.getItems() != null && mAdapter!!.getItems()!!.size > 0) return
        mAdapter!!.addItems(infos!!.toMutableList())

    }


}
